import {
	request
} from '@/pages_nbst/utils/request.js'

export function getExamReq(type) {
	return request({
		url: `exam`,
		method: 'get',
		params: {type}
	})
}

export function checkExamReq(examId, data) {
	return request({
		url: `exam/${examId}/check`,
		method: 'post',
		data,
	})
}

export const getPageQuestionReq = (pageId) => {
	return request({
		url: `page/${pageId}/question`,
		method: 'get'
	})
}

export const submitExamReq = (examId, pageId, data) => {
	return request({
		url: `userexam/${examId}/page/${pageId}`,
		method: 'post',
		data,
	})
}

export const getUserExamReq = (id) => {
	return request({
		url: `userexam/${id}`,
		method: 'get'
	})
}

export const  getExamListReq = (params) => {
	return request({
		url: `userexam`,
		method: 'get',
		params,
	})
}
